#pragma once

class CBaseObject
{
public:
	CBaseObject(void);
	virtual ~CBaseObject(void);
protected:
	static unsigned long		s_uIndex;
	unsigned long				m_uIndex;
};

class CMyString : public CBaseObject
{
public:
	CMyString();
	CMyString(const wchar_t* const psz);
	virtual ~CMyString();

	//copy constructor
	CMyString(const CMyString& myStr);
	//////////////////////////////////////////////////////////////////////////
	//operator overwirter
	operator const wchar_t*() const;

	CMyString & operator = (const CMyString &myStr);

	CMyString operator + (const wchar_t* const psz);
	CMyString operator + (const CMyString &myStr);

	CMyString &operator += (const wchar_t* const psz);
	CMyString &operator += (const CMyString &myStr);

	bool operator == (const wchar_t* const psz);
	bool operator == (const CMyString &myStr);
	 //////////////////////////////////////////////////////////////////////////
	 //public methods
public:
	void		Append(const wchar_t* const psz);
	bool		CompareNoCase(const wchar_t* const psz);
	bool		CompareNoCase(const CMyString &myStr);
private:
	void		FreeData();
	void		InitData(const wchar_t* const psz);
private:
	wchar_t*		m_pszData;
};